<template>
  <view>
    <view class="search">
      <view @click="locations" class="searchs">
        {{ locationName ? locationName : '请输入地址' }}
        <image src="../../static/filling/location.png"></image>
      </view>
      <!-- 享受打折提示 -->
      <!-- <view class="swiper">
        <mosowe-swiper
          :lists="gifAll"
          :touchable="false"
          imageKey="imageurl"
          vertical
          :height="45"
          @bclick="bannerChange"
        />
      </view> -->
    </view>
  </view>
</template>

<script setup lang="ts">
// import mosoweSwiper from '@c/mosowe-swiper/mosowe-swiper.vue';
// import { fillingGif } from '@/gql/filling';
// import { navTo } from '@/utils/navigator';
// import { showLoading } from '@/utils/prompt';
// import { toPublish } from '@mqtt';
// import type { Ref } from 'vue';
// import { ref } from 'vue';
// const gifAll: Ref<object[]> = ref([]);

const emit = defineEmits(['locations']);
const props = defineProps({
  locationName: { type: String },
});
// function init() {
//   showLoading('加载中');
//   const payload = {
//     query: fillingGif,
//     variables: {
//       type: 'ditu_yh',
//     },
//   };
//   toPublish('ql/driver/getGifList', payload, (obj: any) => {
//     const { data } = obj;
//     gifAll.value = data.ads;
//   });
// }
// init();

/**
 * 点击搜索并进入选择地址页
 */
function locations() {
  emit('locations');
}
/**
 * 点击滚动图片 进入不同页面
 */
// function bannerChange(e) {
//   switch (e.index) {
//     case 0:
//       uni.redirectTo({
//         url: '/pages/appointment/appointment?type=delivery',
//       });
//       break;
//     case 1:
//       navTo('mine/Recharge');
//       break;
//   }
// }
</script>

<style scoped lang="less">
.search {
  width: 95%;
  position: fixed;
  // #ifndef MP-WEIXIN
  top: 60px;
  // #endif
  // #ifdef MP-WEIXIN
  top: 100px;
  // #endif
  left: 2.5%;
  z-index: 9;

  .searchs {
    background-color: white;
    padding: 0px 20rpx;
    box-sizing: border-box;
    height: 74rpx;
    background: #ffffff;
    box-shadow: 0px 4px 4px 4px rgba(232, 232, 232, 0.5);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 28rpx;
    color: #666;
    image {
      width: 62rpx;
      height: 60rpx;
    }

    input {
      width: 80%;
      font-size: 24rpx;
    }
  }
  .swiper {
    width: 45%;
    margin-top: 20rpx;
  }

  .Discount {
    width: 336rpx;
    height: 34rpx;
    margin-top: 20rpx;
  }
}
</style>
